<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title>新闻中心</title>
		<link rel="stylesheet" type="text/css" href="static/project/css/style.css" />
		<link rel="stylesheet" type="text/css" href="static/project/css/news.css" />
		<style>
			ol,
			li {
				list-style-type: none;
			}
			.min .container .pages{
				width: 577px;
				overflow: hidden;
				margin: auto;
				margin-bottom: 150px;
			}
			.min .container .pages ol li {
				float: left;
			}
			.min .container .pages ol li a{
				display: block;
				width: 33px;
				height: 33px;
				text-align: center;
				line-height: 33px;
				border: 1px solid #01a1ff;
				color: #272727;
				margin-right: 47px;
				float: left;
			}
			.min .container .pages ol li a:hover{
				background: #01a1ff;
				color: #fff;
			}
			.min .container .pages ol li a.current{
				background: #01a1ff;
				color: #fff;
			}

		</style>
	</head>

	<body>
						<!--页头部分-->
<?php include('app/index/public/html/_header.html');?>
		<!--banners图-->
		<div class="banners">
			<img src="<?php echo $banner['file'];?>" />
		</div>
		<div class="min">
			<div class="container">
				<div class="title">
					<ul>
						<?php foreach($nav as $k=>$v){?>
							<?php if($cate == $v['Id']){?>
								<li class="current"><a href="index.php?a=index&b=news&c=news&cate=<?php echo $v['Id']?>"><?php echo $v['name']?></a></li>
							<?php }else{?>
								<li><a href="index.php?a=index&b=news&c=news&cate=<?php echo $v['Id']?>"><?php echo $v['name']?></a></li>
							<?php }?>
						<?php }?>
					</ul>
				</div>
				<p class="loction">
					<a href="index.php?a=index&b=index&c=index">首页></a>
					<a href="index.php?a=index&b=news&c=news">新闻中心></a>
					<a href="#">公司新闻</a>
				</p>
				<ul class="list">
					<?php foreach($news as $k=>$v){?>
						<li>
							<a href="index.php?a=index&b=news_detail&c=news_detail&id=<?php echo $v['Id']?>" class="left"><img src="<?php echo $v['thumb'];?>" /></a>
							<div class="right">
								<div class="text">
									<h2><a href="index.php?a=index&b=news_detail&c=news_detail&id=<?php echo $v['Id']?>"><?php echo $v['title'];?></a></h2>
									<p>
										<a href="index.php?a=index&b=news_detail&c=news_detail&id=<?php echo $v['Id']?>">
											<?php echo mb_substr(strip_tags($v['abstract']), 0,100,'utf-8');?>
										</a>
									</p>
								</div>
								<div class="time">
									<span class="day"><?php echo date('d',$v['time']);?></span>
									<span class="month"><?php echo date('Y/m',$v['time']);?></span>
								</div>
							</div>
						</li>
					<?php }?>
				</ul>
				<div class="pages">
					<!--分页-->
					<ol>
						<li class="page-prev">
							<a href="index.php?a=index&b=news&c=news&cate=<?php echo $cate;?>&page=1" target="_self" title="首页">首页</a>
						</li>
						<?php if($page<3){$start=1;if($totolpage<5){$end=$totolpage;}else{$end=5;}?>
						<?php for(;$start<=$end;$start++){if($start==$page){?>
						<li class="on">
							<a class="current" href="index.php?a=index&b=news&c=news&cate=<?php echo $cate;?>&page=<?php echo $start?>">
								<?php echo $start?>
							</a>
						</li>
						<?php }else{?>
						<li>
							<a href="index.php?a=index&b=news&c=news&cate=<?php echo $cate;?>&page=<?php echo $start?>">
								<?php echo $start?>
							</a>
						</li>
						<?php }}?>
						<?php }else if($page>($totolpage-3)){$start=$totolpage-4;$end = $totolpage;?>
						<?php for(;$start<=$end;$start++){if($start==$page){?>
						<li class="on">
							<a class="current" href="index.php?a=index&b=news&c=news&cate=<?php echo $cate;?>&page=<?php echo $start?>">
								<?php echo $start?>
							</a>
						</li>
						<?php }else{?>
						<li>
							<a href="index.php?a=index&b=news&c=news&cate=<?php echo $cate;?>&page=<?php echo $start?>">
								<?php echo $start?>
							</a>
						</li>
						<?php }}?>

						<?php }else{$start = $page-2;$end = $page+2;?>
						<?php for(;$start<=$end;$start++){if($start==$page){?>
						<li class="on">
							<a class="current" href="index.php?a=index&b=news&c=news&cate=<?php echo $cate;?>&page=<?php echo $start?>">
								<?php echo $start?>
							</a>
						</li>
						<?php }else{?>
						<li>
							<a href="index.php?a=index&b=news&c=news&cate=<?php echo $cate;?>&page=<?php echo $start?>">
								<?php echo $start?>
							</a>
						</li>
						<?php }}?>
						<?php }?>
						<!--<li><a href="#">...</a></li>-->
						<li class="page-next">
							<a href="index.php?a=index&b=news&c=news&cate=<?php echo $cate;?>&page=<?php echo $totolpage?>" target="_self" title="尾页">尾页</a>
						</li>
					</ol>

				</div>
			</div>
		</div>
		<!--底部-->
<?php include('app/index/public/html/_footer.html');?>